<%@page import="org.apache.taglibs.standard.tag.rt.core.ForEachTag"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@page import="dao.Orders"%>
<%@page import="model.OrderDetailViewModel"%>
<%@page import="java.util.List" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Order detail</title>
</head>
<body>
	<%
		String orderCode = request.getParameter("id");
		Orders ordD = new Orders();
		List<OrderDetailViewModel> od = ordD.getOrderDetails(orderCode, null);
		if(od != null || od.size() == 0){
	%>
		<table width="100%">
			<tr>
				<th style="border: 1px solid #000">Mã Đơn Đặt Hàng</th>
				<th style="border: 1px solid #000">Tên Hàng</th>
				<th style="border: 1px solid #000">Số Lượng</th>
			</tr>
		<% for(int i =0; i < od.size() ; i ++) 
			{
				OrderDetailViewModel dt = od.get(i);
		%>
			<tr>
				<td style="border: 1px solid #000"><%=dt.getOrderId() %></td>
				<td style="border: 1px solid #000"><%=dt.getProductName() %></td>
				<td style="border: 1px solid #000"><%=dt.getQty() %></td>
			</tr>
		<%}%>	
		</table>
	<%
		}else{
			out.print("<center>Chưa có dữ liệu</center>");			
		}
	%>
</body>
</html>